package com.wh.wisdomsite.xbox.server.dbCompare;

/**
 * Created by Administrator on 14-9-1.
 */
public class CompareResult {


    /**
     * 以下三个属性主要用于用于比对字段类型,同时,除C_TYPE外,其余两属性还将用于
     * 比对字段大小
     */
    private String tableName; //表名
    private String columnName; //字段名称
    private String columnType; //字段类型
    /**
     * 下面3个字段与T_NAME,C_NAME一起用于比对字段大小
     */
    private Integer columnSize; //字段大小
    private Integer compColumnSize; //被比对字段大小


    private Integer columnPrecision;//字段精度
    private Integer compColumnPrecision;//被比对字段精度
    private Integer columnScale;//小数位
    private Integer compColumnScale;//被比对字段小数位


    private String columnComments;//字段注释
    private String compColumnComments;//被比对字段的注释


    private Integer charLength;
    private Integer compCharLength;


    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public String getColumnName() {
        return columnName;
    }

    public void setColumnName(String columnName) {
        this.columnName = columnName;
    }


    public Integer getColumnSize() {
        return columnSize;
    }

    public void setColumnSize(Integer columnSize) {
        this.columnSize = columnSize;
    }

    public Integer getCompColumnSize() {
        return compColumnSize;
    }

    public void setCompColumnSize(Integer compColumnSize) {
        this.compColumnSize = compColumnSize;
    }

    public Integer getColumnPrecision() {
        return columnPrecision;
    }

    public void setColumnPrecision(Integer columnPrecision) {
        this.columnPrecision = columnPrecision;
    }

    public Integer getCompColumnPrecision() {
        return compColumnPrecision;
    }

    public void setCompColumnPrecision(Integer compColumnPrecision) {
        this.compColumnPrecision = compColumnPrecision;
    }

    public Integer getColumnScale() {
        return columnScale;
    }

    public void setColumnScale(Integer columnScale) {
        this.columnScale = columnScale;
    }

    public Integer getCompColumnScale() {
        return compColumnScale;
    }

    public void setCompColumnScale(Integer compColumnScale) {
        this.compColumnScale = compColumnScale;
    }

    public String getColumnComments() {
        return columnComments;
    }

    public void setColumnComments(String columnComments) {
        this.columnComments = columnComments;
    }

    public String getCompColumnComments() {
        return compColumnComments;
    }

    public void setCompColumnComments(String compColumnComments) {
        this.compColumnComments = compColumnComments;
    }

    public String getColumnType() {
        return columnType;
    }

    public void setColumnType(String columnType) {
        this.columnType = columnType;
    }



    public CompareResult(String tableName, String columnName, String columnType) {
        this.tableName = tableName;
        this.columnName = columnName;
        this.columnType = columnType;
    }


    public CompareResult(String tableName, String columnName, Integer columnSize, Integer compColumnSize) {
        this.tableName = tableName;
        this.columnName = columnName;
        this.columnSize = columnSize;
        this.compColumnSize = compColumnSize;
    }

    public CompareResult(String tableName, String columnName,String columnType, Integer columnSize, Integer compColumnSize, Integer columnPrecision, Integer compColumnPrecision,
                         Integer columnScale, Integer compColumnScale, Integer charLength, Integer compCharLength) {
        this.tableName = tableName;
        this.columnName = columnName;
        this.columnType = columnType;
        this.columnSize = columnType.equals("VARCHAR2") ? charLength : columnSize;
        this.compColumnSize = columnType.equals("VARCHAR2") ? compCharLength :compColumnSize;
        this.columnPrecision = columnPrecision;
        this.compColumnPrecision = compColumnPrecision;
        this.columnScale = columnScale;
        this.compColumnScale = compColumnScale;
        this.charLength = charLength;
        this.compCharLength = compCharLength;
    }

    public CompareResult(String tableName, String columnName, String columnComments, String compColumnComments) {
        this.tableName = tableName;
        this.columnName = columnName;
        this.columnComments = columnComments;
        this.compColumnComments = compColumnComments;
    }

    public CompareResult() {
    }

    @Override
    public String toString() {
        return "CompareResult{" +
                "tableName='" + tableName + '\'' +
                ", columnName='" + columnName + '\'' +
                ", columnType='" + columnType + '\'' +
                ", columnSize=" + columnSize +
                ", compColumnSize=" + compColumnSize +
                ", columnPrecision=" + columnPrecision +
                ", compColumnPrecision=" + compColumnPrecision +
                ", columnScale=" + columnScale +
                ", compColumnScale=" + compColumnScale +
                ", columnComments='" + columnComments + '\'' +
                ", compColumnComments='" + compColumnComments + '\'' +
                '}';
    }
}
